angular.module('DevHelp')

.service('DevHelpNav', ['DEVHELPCONSTANTS', function (DEVHELPCONSTANTS) {
    var o = {};

    o.getNavItems = function () {
        return angular.copy(DEVHELPCONSTANTS.navItems);
    };
    o.getSummary = function (itemId, summaryId) {
        var navItems = DEVHELPCONSTANTS.navItems,
            len = navItems.length,
            i;
        for (i = 0; i < len; i++) {
            if (navItems[i].id === itemId) {
                break;
            }
        }
        if (i === len) {
            return null;
        }
        var summaries = navItems[i].summaries,
            len = summaries.length;
        for (i = 0; i < len; i++) {
            if (summaries[i].id === summaryId) {
                break;
            }
        }
        if (i === len) {
            return null;
        }
        return angular.copy(summaries[i]);
    };

    return o;
}]);